﻿ #region Disclaimer/Info
 
 /////////////////////////////////////////////////////////////////////////////////////////////////
 //
 //   File:		JoinedSubclassPluralizedTableApplier.cs
 //   Website:		http://dexterblogengine.com/
 //   Authors:		http://dexterblogengine.com/About.ashx
 //   Rev:		1
 //   Created:		19/01/2011
 //   Last edit:		19/01/2011
 //   License:		GNU Library General Public License (LGPL)
 //   File:            JoinedSubclassPluralizedTableApplier.cs
 //   For updated news and information please visit http://dexterblogengine.com/
 //   Dexter is hosted to Codeplex at http://dexterblogengine.codeplex.com
 //   For any question contact info@dexterblogengine.com
 //
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
 #endregion

using System;
using ConfOrm.Shop.Inflectors;
using Dexter.Repository.NHibernate.Configuration;

namespace Dexter.Repository.NHibernate.ConfORM.DexterNaming {
	internal class JoinedSubclassPluralizedTableApplier : ConfOrm.Shop.InflectorNaming.JoinedSubclassPluralizedTableApplier
	{
		readonly INHibernateConfiguration nHibernateConfiguration;
		public JoinedSubclassPluralizedTableApplier ( IInflector inflector , INHibernateConfiguration nHibernateConfiguration ) : base ( inflector ) {
			this.nHibernateConfiguration = nHibernateConfiguration;
		}

		public override string GetTableName ( Type subject ) {
			return string.Concat ( nHibernateConfiguration.DatabaseTablePrefix, base.GetTableName ( subject ) );
		}
	}
}
